package JAVA300.第十一章多线程;

/**
 * 守护线程
 */
public class thread_13_daemon {
    public static void main(String[] args) {

        Person person = new Person();
        God god = new God();

        Thread t1 = new Thread(person);
        t1.start();
        Thread t2 = new Thread(god);
        t2.start();

        t2.setDaemon(true);//调整为守护线程
    }



}

class Person implements Runnable{
    @Override
    public void run() {
        for (int i= 0;i<365*100;i++){
            System.out.println("happy life");

        }
        System.out.println("ooooooooooo");
    }
}

class God implements Runnable{
    @Override
    public void run() {
        for (int i= 0;i<365*100000;i++){
            System.out.println("bless");

        }
        System.out.println("ooooooooooo");
    }

}
